RoleAttribute = class("RoleAttribute")

--[[
角色战斗属性文件
属性如下：
hpMax   血量上限
hp 		血量
atk   	攻击
speed 	速度，对于boss来说是个table
weapon	武器
res 	资源
skills	技能，是个table

]]

function RoleAttribute:ctor(...)
    local arg = { ...}
    if (#arg >= 1) then
        local roleData = RoleConfig[arg[1]]
        if (roleData == nil) then
            GameLog.Error("role id doesn't exist! id: " + arg[1])
            return
        end
        self.id = arg[1]
        self.name = roleData.name
        self.hpMax = roleData.hp
        self.hp = roleData.hp
        self.mp = 0
        self.mpMax = 100
        self.atk = roleData.atk
        self.speed = roleData.speed
        self.weapon = roleData.weapon
        self.res = roleData.res
        self.skills = roleData.skills
        self.entrance = roleData.entrance
        self.flyWord = roleData.flyWord
    end
end

--[[
function RoleAttribute:new(hp, atk, speed, weapon, resPath)
	local object = {}
	object.hp = hp or 100
	object.atk = atk or 20
	object.speed = speed or 10
	object.weapon = weapon
	object.res = resPath

	setmetatable(object, RoleAttribute)

	return object
end


function RoleAttribute:new()
	-- body
end
]]

function RoleAttribute:cal()

end
 